﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

//namespace Level
namespace Sprites
{
	public class SpriteTemplate
	{
		public int lastVisibleTick = -1;
		public Sprite sprite;
		public bool isDead = false;
		private bool winged;

		private int type;

		public SpriteTemplate(int type, bool winged)
		{
			this.type = type;
			this.winged = winged;
		}

		public void spawn(LevelScene world, int x, int y, int dir)
		{
			if (isDead) return;

			if (type == Enemy.ENEMY_FLOWER)
			{
				sprite = new FlowerEnemy(world, x * 16 + 15, y * 16 + 24);
			}
			else
			{
				sprite = new Enemy(world, x * 16 + 8, y * 16 + 15, dir, type, winged);
			}
			sprite.spriteTemplate = this;
			world.addSprite(sprite);
		}
	}
}